<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no,minimum-scale=1,maximum-scale=1.0" />

<!-- 
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, target-densityDpi=medium-dpi" />
 -->
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>我的资料 - 红高粱</title>
<link type="text/css" rel="stylesheet" href="../m/css/change.css"/>
<script type="text/javascript" src="../m/js/jquery.min.js"></script>
<script type="text/javascript" src="../m/js/huaping.js"></script>
<script type="text/javascript" src="../m/js/jquery.tmpl.min.js"></script>
<script type="text/javascript" src="../m/js/cart.js"></script>
<script type="text/javascript" src="../m/js/jquery.msg.src.js"></script>
<script type="text/javascript" src="../m/js/user.js"></script>
<script type="text/javascript" src="../m/js/loginValid.js"></script>
<style type="text/css">
header{width:100%;background-image:url("");overflow:hidden;background-size:cover; }
header .avatar{width:45%;margin:0 auto; margin-top:20px; }
header .avatar img{ width:100%}
header .c_pass{float:left;width:35%; margin:5% 3.946% 5.5% 11.23%;}
header .c_pass img{ width:100%}
header .exit{float:left;width:35%;margin:5% 10.23% 5.5% 3.946%; }
header .exit img{ width:100%}
body{ background-image:url("../m/images/c_shop_bg2.png");}
*{ margin:0; padding:0;}
.clear_both{clear:both;margin-bottom:50px;}
.clear{clear:both;}
.menu_list a{text-shadow:#5f472d 0px 0px 2px; color:#fff; font-weight:bold; text-decoration: none;}
.menu_list{height:52px;float:left;width:100%;text-align:left;line-height:50px;overflow:hidden;margin-bottom:0px;}
.nav_list {float:left;}
.nav_list img{ height:50px;}
.my_order,.my_zl,.my_card{float:left; width:49.3333%; text-align:center; overflow:hidden;}
.my_order a{color:#bfbfbf;}
.menu_content{
width:97%;text-align:center;margin:0 auto;overflow:hidden;box-shadow: 0px 0px 2px #26282b;
background:url('../m/images/user_textfield_bg.png') no-repeat;opacity:2; color:#686868;border:none;
}
.menu_content div{line-height:48px;}
input{border:none;font-size:1em; width:200px;background-color:#2b2e31;color:#fff;background-color:transparent;}
textarea { background-color:#f7f8fa; border:none; padding:10px 0; width:90%;font-size:1em;}
.href_style{text-decoration:none;}
.button{width:96%; margin:0 auto; margin-top:20px;}
.txt{width:28%;text-align:right; float:left;color:#fff;font-size:1em;}
.txt2{width:70%;text-align:left;float:right;}

.button {width:96%;margin:0 auto;overflow:hidden;margin-top:10px;}
#updateButton img{width:98%;}
#cancel{background:url("../m/images/cancel.png") no-repeat;height:45px;width:47.5%;background-size: contain; float:right;}
.border{background:url("../m/images/u_info_list2.png") repeat-x;background-position:bottom;overflow:hidden;}

</style>
<!-- 
.border{background:url("../m/images/u_info_list.png") repeat-x;background-position:bottom;overflow:hidden;}
.menu_content{width:96%;text-align:center;margin:0 auto;overflow:hidden;box-shadow: 0px 0px 2px #26282b;background-color:#2b2e31;border:1px solid #272a2d;border-radius:0.3em; color:#686868;}
 -->
<script type="text/javascript">
	$(document).ready(function(){
		var userId = '${sessionScope.user.id}';
		loginValid(userId);
		$('#gender${sessionScope.user.gender}').attr('selected', 'selected');
		var birthday1 = '${sessionScope.user.birthday}';
		var m = birthday1.split('_')[0];
		var d = birthday1.split('_')[1];
		$('#m'+m).attr('selected', 'selected');
		$('#d'+d).attr('selected', 'selected');
		//更新信息
		$("#updateButton").click(function(){
			var realName = $('#realName').val();
			alert(realName);
			var phone = $('#phone').val();
			var gender = $("#gender").val();
    		var m = $("#birthday_m").val();
    		var d = $("#birthday_d").val();
    		var birthday = m+"_"+d;
			$.ajax({
				url:"../user/updateUser",
				type:"POST",
				data:{id:userId,realName:realName,phone:phone,gender:gender,birthday:birthday},
				dataType:"json",
				success:function(data){
					if(data.ok=='ok'){
						alert(data.msg);
					}else{
						alert('更新失败，请稍后再试。');
						location.reload(true);
					}
				}
			});
		});
		
	});
</script>
</head>
<header style="margin-top:13%;">
	<div class="header">
		<div class="avatar"><a href="#"><img src="../m/images/logo.png"></a></div>
		<div class="c_pass"><a href="#"><img id="updatePass" src="../m/images/c_pass.png"></a></div>		
		<div class="exit"><a href="#"><img id="userExit" src="../m/images/exit.png"></a></div>
	</div>
</header>
<body>
    <div style="width:100%;float:left;">
		<div class="menu_list">
			<div class="my_order" style="height:100%;background:url(../m/images/user_info_unchoose.png) repeat-x;">
				<a href="javascript:" onclick="location.href='./backend?cid=${loginId}'" class="href_style">我的订单</a>
			</div>
			<div class="nav_list">
				<img src="../m/images/user_list2.png">
			</div>
			<div class="my_zl" style="height:100%;background:url(../m/images/user_info_unchoose.png) no-repeat;">
				<a href="javascript:location.reload(true);" class="href_style">我的资料</a>
			</div>
			<!-- <div class="nav_list">
				<img src="../m/images/user_list.png">
			</div> -->
		</div>
		<div class="menu_content">
				<div class="arrow" style=" position:absolute;left:70%;line-height:0px;">
					<img src="../m/images/user_info_choose.png">
				</div>
			<div class="border">
				<div  class="txt">手机：</div>
				<div  class="txt2"><input type="text" id="phone" value="${sessionScope.user.phone}" readOnly="true"></input></div>	
			</div>
			<div class="">
				<div  class="txt">姓名：</div>	
				<div  class="txt2"><input type="text" id="realName" value="${sessionScope.user.realName}"></input></div>	
			</div>
			<div class="border" style="display:none">
				<div  class="txt">性别：</div>	
				<div  class="txt2">
				<select id="gender" name="gender">
           			<option value ="1" id="gender1">我是帅哥</option>
   					<option value ="0" id="gender0">我是靓妹</option>
				</select>
				</div>
			</div>
			<div class="border" style="display:none">
				<div  class="txt">生日：</div>	
				<div  class="txt2">
				<select id="birthday_m">
	               			<option value ="1" id='m1'>1</option>
	      					<option value ="2" id='m2'>2</option>
	      					<option value ="3" id='m3'>3</option>
	      					<option value ="4" id='m4'>4</option>
	      					<option value ="5" id='m5'>5</option>
	      					<option value ="6" id='m6'>6</option>
	      					<option value ="7" id='m7'>7</option>
	      					<option value ="8" id='m8'>8</option>
	      					<option value ="9" id='m9'>9</option>
	      					<option value ="10" id='m10'>10</option>
	      					<option value ="11" id='m11'>11</option>
	      					<option value ="12" id='m12'>12</option>
 						</select> 
 					月
 					<select id="birthday_d">
	               			<option value ="1" id='d1'>1</option>
	      					<option value ="2" id='d2'>2</option>
	      					<option value ="3" id='d3'>3</option>
	      					<option value ="4" id='d4'>4</option>
	      					<option value ="5" id='d5'>5</option>
	      					<option value ="6" id='d6'>6</option>
	      					<option value ="7" id='d7'>7</option>
	      					<option value ="8" id='d8'>8</option>
	      					<option value ="9" id='d9'>9</option>
	      					<option value ="10" id='d10'>10</option>
	      					<option value ="11" id='d11'>11</option>
	      					<option value ="12" id='d12'>12</option>
	      					<option value ="13" id='d13'>13</option>
	      					<option value ="14" id='d14'>14</option>
	      					<option value ="15" id='d15'>15</option>
	      					<option value ="16" id='d16'>16</option>
	      					<option value ="17" id='d17'>17</option>
	      					<option value ="18" id='d18'>18</option>
	      					<option value ="19" id='d19'>19</option>
	      					<option value ="20" id='d20'>20</option>
	      					<option value ="21" id='d21'>21</option>
	      					<option value ="22" id='d22'>22</option>
	      					<option value ="23" id='d23'>23</option>
	      					<option value ="24" id='d24'>24</option>
	      					<option value ="25" id='d25'>25</option>
	      					<option value ="26" id='d26'>26</option>
	      					<option value ="27" id='d27'>27</option>
	      					<option value ="28" id='d28'>28</option>
	      					<option value ="29" id='d29'>29</option>
	      					<option value ="30" id='d30'>30</option>
	      					<option value ="31" id='d31'>31</option>
 						</select> 
 					日	
 					</div>
			</div>	
			<div style="display:none"> 
				<div  class="txt">积分：</div>					
				<div  class="txt2"><input type="text" id="credits" value="${sessionScope.user.credits}"  readOnly="true"></input></div>	
			</div>
		</div>
		<div class="clear"></div>
		<div class="button">
				<span id="updateButton"><img  src="<c:url value="/m/images/save2.png"/>"></span>
				<!-- <span><input type="button" id="cancel"></span> -->
		</div>	
	</div>
</body>
<div class="clear_both"></div>
<%@ include file="footer.jsp" %>
</html>